package com.itheima.a05threadmethod2;

public class ThreadDemo {
    public static void main(String[] args) {
        //setPriority(int newPriority)设置线程的优先级
        //final int getPriority()获取线程的优先级

        //final void setDaemon(boolean on)设置为守护线程
        //细节：
        //当其他的非守护线程执行完毕之后，守护线程会陆续结束

        //创建线程要执行的参数对象
        MyRunnable r = new MyRunnable();

        //创建线程对象
        Thread t1 = new Thread(r);
        Thread t2 = new Thread(r);

        t1.setPriority(1);
        t2.setPriority(10);

        t1.start();
        t2.start();
    }
}
